<template>
	<view class="u-flex-1">
		<u-input placeholder="请选择" v-model="label" type="select" @click="show=true" />
		<u-picker mode="selector" v-model="show"  :default-selector="[0]" range-key="label" :range="cargoTypes" @confirm="confirm"></u-picker>
	</view>
</template>

<script setup>
	const cargoType = defineModel()
	const show = ref(false)
	const label = defineModel('label')
	const cargoTypes = computed(()=>$store('user').cargoTypes)
	
	function confirm(e){
		label.value = cargoTypes.value[e[0]].label
		cargoType.value = cargoTypes.value[e[0]].value
	}
</script>

<style>

</style>